<script>
export default {
    inject: { cellRenderSlotProvider: { default: null } },
    props: {
        cellRenderData: Object,
        cellRenderFrame: Object
    },
    render() {
        if (!this.cellRenderSlotProvider) {
            return <span></span>
        }
        const slots = this.cellRenderSlotProvider.$scopedSlots
        let desSlot
        for (let key in slots) {
            if (key == this.cellRenderFrame.slof) {
                desSlot = slots[key]
                break
            }
        }
        if (!desSlot) {
            return <span></span>
        }
        return (
            <span>
                {desSlot({
                    cellRenderData: this.cellRenderData,
                    cellRenderFrame: this.cellRenderFrame
                })}
            </span>
        )
    }
}
</script>
